1. Field of the Invention
The present invention generally relates to monitoring of computer systems, and more particularly to a method of accumulating performance data from hardware counters in a computer system or device.
2. Description of the Related Art
As electronic systems become more complicated, there is a greater need for monitoring the performance of the systems to ensure optimum operation and identify any defects or design problems. This concern is particularly important for integrated circuits such as processors and other state-of-the-art devices used in computer systems. A typical processor includes various execution units, registers, buffers, memories, and other functional units which are all formed by integrated circuitry. Hardware counters may be embedded within this circuitry to keep track of various events. Today's processors typically provide performance monitoring counters that count the time, cycles, or other types of events between a first event and a second event. For example, if latency is to be measured, the counted events are typically cycles, and typical start and stop events might be instruction fetch and instruction completion, load fetch and load completion, or cache miss and cache reload. Alternatively, if the reason for a large cache reload latency is being investigated, typical start and stop events might be cache load and cache reload, and the counted events might be load retries in the interconnection fabric, or some action that is performed in order to reload the cache. In addition to counting events between a start and a stop event, it is often desirable to see if the number of counted events exceeds a given threshold, or to measure how frequently the number of counted events exceeds the threshold. In order to provide this additional functionality, the hardware can support a threshold register which contains the value against which the total number of counted events is to be compared. Values in hardware counter registers may be swapped out with previously stored values as part of a context switch which changes the state of the processor
Due to the complexity of today's processors, there is a large number of different types of events that can be counted, as well as a large number of different possible start and stop events that need to be specified. The typical numbers of counted events between start and stop events for a complex computer system can vary over a huge range. For example, some pairs of start and stop events may be separated by only a few counted events, whereas other pairs of events may be separated by a million or more counted events.